<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*,com.enterprise.daoImpl.*" pageEncoding="UTF-8"%>
<%@include file="head.jsp" %>
<table width="991" height="353" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:16px; margin-bottom:26px;">
  <tr>
    <td width="13" valign="top"></td>
    <td width="209" valign="top"><table width="209" height="32" border="0" cellpadding="0" cellspacing="0" bgcolor="#F8F6DD">
      <tr>
        <td width="87" class="ab4" style="padding-left:15px; padding-top:3px;">新闻中心</td>
        <td width="13" class="ab4" ><img src="images/imgbyj/line.gif" width="13" height="32" /></td>
        <td width="109" class="r2" style="padding-top:7px;">NEWS CENTER </td>
      </tr>
    </table>
        <table width="209" height="28" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><img src="images/imgbyj/ab2.gif" width="209" height="28" /></td>
          </tr>
        </table>
      <table width="209" height="84" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td align="center" valign="top" background="images/imgbyj/ab3.gif">
<%
	String str=request.getParameter("BigClass");
	int id;
	if(str!=null&&!str.equals(""))
		id=Integer.parseInt(str);
	else
		id=1;
	NodeDaoImpl nodeDaoImpl=new NodeDaoImpl();
	List<Node> nodes=nodeDaoImpl.getNodes(-1);
	if(nodes!=null)
	for(Node node:nodes){

 %>
	

                <table width="171" height="29" border="0" cellpadding="0" cellspacing="0" background="images/imgbyj/abbg.gif" style="margin-bottom:12px;">
                  <tr>
                    <td align="left"><a href="NewsClass.asp?BigClass=<%=node.getId()%>" class="lmenu" style="padding-left:50px; padding-top:4px;"><%=node.getClassName()%></a></td>
                  </tr>
                </table>
<%} %>
              <%-- <%rslist.movenext 
loop
rslist.close
set rslist=nothing
%>
 --%>

            </td>
          </tr>
      </table>
      <table width="209" height="16" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><img src="images/imgbyj/ab4.gif" width="209" height="16" /></td>
        </tr>
      </table></td>
    <td width="22" valign="top"></td>
    <td width="747" valign="top"><table width="747" height="28" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="69" class="ab4" style="padding-top:5px;"><%=nodeDaoImpl.getNode(id).getClassName()%></td>
        <td width="113"><img src="images/imgbyj/ab5.gif" width="89" height="28" /></td>
        <td width="404" align="right"><img src="images/imgbyj/ab6.gif" width="45" height="28" /></td>
        <td width="161" class="ab5" style="padding-top:5px;">&gt; 新闻中心 &gt; <%=nodeDaoImpl.getNode(id).getClassName()%></td>
      </tr>
    </table>
        <table width="740" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#D0D0C5">
          <tr>
            <td height="1"></td>
          </tr>
        </table>
      <table width="723" height="264" border="0" align="center" cellpadding="0" cellspacing="0" style=" margin-top:41px; margin-left:12px; margin-right:12px;">
          <tr>
            <td valign="top" class="aboutus">
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <%
    PageDaoImpl pageDaoImpl=new PageDaoImpl();
      			int currentPage=1;
				if(request.getParameter("pageNo")!=null){
					currentPage=Integer.parseInt(request.getParameter("pageNo"));
				}   		
				Page page2=new Page(10,pageDaoImpl.getNewsRecord(id),currentPage);
				System.out.println(pageDaoImpl.getNewsRecord(id)+"+"+id);
				currentPage=page2.getCurrentPage();
    			
    
    
    	NewsDaoImpl newsDaoImpl=new NewsDaoImpl();
    	List<News> news=newsDaoImpl.getNewsListById(id);
    	System.out.println(id);
    	if(news!=null&&news.size()>0){
    		int i;
    	for(i=page2.getFromIndex();i<page2.getToIndex();i++){
    			News n=news.get(i); 
    			System.out.println(page2.getToIndex()+" "+news.size());
    		/* 	System.out.println(news.size()); */
     %>         
    
                  <tr>
                    <td width="6%" height="45" align="center" style="BORDER-bottom: #E7E7E7 1px dashed"><img src="img/arrow_6.gif" width="11" height="11"></td>
                    <td width="76%" height="24" style="BORDER-bottom: #E7E7E7 1px dashed">
                        <a href="shownews.asp?id=<%=n.getId()%>" target="_blank"><%= n.getTitle() %></a>　</td>
                    <td width="18%" style="BORDER-bottom: #E7E7E7 1px dashed"><font color="#999999">[<%= new SimpleDateFormat("YYYY-MM").format(n.getAddDate()) %>] </font></td>
                  </tr>
                  <%} }%>
  <%--                 <%
rs.movenext
if rs.eof then exit for
next
%> --%>
                  <tr valign="bottom">
                    <td height="50" colspan="3" align="center" >
      	<form name="showpages" method="Post" action="NewsClass.jsp">
      		<table align="center" width="80%"  border="0" cellpadding="0" cellspacing="0">
      		<tbody>
    
      			<tr><td align="center">共 <b><%=news.size() %></b> 条记录&nbsp;&nbsp;<a href="NewsClass.jsp?pageNo=1">首页</a><a href="NewsClass.jsp?pageNo=<%=currentPage-1%>"> 上一页</a>&nbsp;<a href="NewsClass.jsp?pageNo=<%=currentPage+1%>">下一页<a href="NewsClass.jsp?pageNo=<%=page2.getPageCount()%>">&nbsp;尾页</a> &nbsp;页次：<strong><font color="red"><%=currentPage %></font>/<%=page2.getPageCount() %></strong>页 &nbsp;<b>10</b>条记录/页&nbsp;转到：
      			<select name="pageNo" size="1" onchange="javascript:submit()">
      			<%
      				int j;
      				for(j=1;j<=page2.getPageCount();j++){ %>
      				<option value="<%=j%>" <%if(j==currentPage){%> <%{%>selected='selected'<%}}%>>第<%=j%>页</option>
      				<%}%>
      			</select></td></tr></tbody></table>
      	</form></td>
                  </tr>
    <%--               <% 
end if
rs.close
set rs=nothing
%> --%>
              </table>
			</td>
          </tr>
      </table></td>
  </tr>
</table>
<%@include file="foot.jsp" %>
